﻿<html>
<head>
    
    <meta charset="utf-8">
    <title>单词集</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1.0, user-scalable=no">
    <!-- Site CSS -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="http://static.bootcss.com/www/assets/css/site.min.css?v5" rel="stylesheet">
    <link href='http://liveser.cn/css/buttom_visible.css' rel="stylesheet">
	
    <style>
    .pagination>li>a, .pagination>li>span {
    
    padding: 6px 9px;
    
}

body { padding-bottom: 70px; }
    </style>
  </head>
  <body>

    
	
      <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          
           <a onclick='history.back()'><font color="#fff" size="5" style="padding: 30px 0px 30 5%">&lt;</font></a><font color="#fff" size="3" align="center" style="padding-left: 35%">我的单词</font>
          
        </div>
        
      </div>
    </div>
	
	  
	  <div class="panel panel-default">
      <div class="panel-heading" style="padding-top: 10px" align="center">主面板</div>
		  <table class="table">
	  <tr>
		  <td style='width: 20%'>单词</td>
		  <td style='width: 20%'>读法</td>
		  <td style='width: 25%'>意义</td>
		  <td style='width: 15%'>词频</td>
		  <td style='width: 20%'>记住了？</td>
	  </tr>
	  
			  
	 
			  
   <?php
   

foreach($words as $dt)
{
    echo '<tr>';
	echo '<td id ="auto'.$dt['auto_id'].'">'.$dt['word'].'</td>';
	echo '<td id="re'.$dt['auto_id'].'" onclick="reading('.$dt['auto_id'].')">+++++</td>';
	echo '<td id="me'.$dt['auto_id'].'" onclick="meaning('.$dt['auto_id'].')">+++++</td>';
	echo '<td id="ad'.$dt['auto_id'].'">'.$dt['fre'].'</td>';
	echo '<td><button type="button" class="btn btn-default" id="reme'.$dt['auto_id'].'" onclick="add('.$dt['auto_id'].')">嗯</button></td>';
	echo '</tr>';
}
?>
			 
			  
		  
  </table>
  
  <div class="container" style="padding: 0px">
   <nav>
  <ul class="pagination pagination" style="padding-left: 25%">
    <li>
      <a href="http://liveser.cn/word/<?php echo ($page-1)%($count/10+1);?>" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <?php
	
	$target = $page < 2 ? 0 : $page-2;
	for($i = $target; $i< (int)$count/10&& $i<$target +5 ; $i++)
	{
		echo '<li><a href="http://liveser.cn/word/'.($i).'">'.($i+1).'</a></li>';
	}
	?>
    <li>
      <a href="http://liveser.cn/word/<?php echo ($page+1)%($count/10+1);?>" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
</div>
   
    </div>
  <nav class="navbar navbar-default navbar-fixed-bottom" style="border: 0;background-color:#000">
  
    <table class='table' style="padding 0px;margin-bottom: 0">
	<tr  style="padding 0px;">
	
	<td style="padding: 12px"><div align="center"><a href='http://liveser.cn/' style="color:#9D9D9D">首页</a></div></td>
	<td style="padding: 12px"><div align="center"><a href='http://liveser.cn/word' style="color:#9D9D9D">背词</a></div></td>
	<td style="padding: 12px"><?php 
			if($flag == 1) 
			{
				echo '<div align="center"><a href="http://liveser.cn/user" style="color:#9D9D9D">个人</a></div>';
			}
			else
			{
				echo '<div align="center"><a href="http://liveser.cn/login" style="color:#9D9D9D">登录</a></div>';
			}
		    ?>
	</td>
	
	</tr>
	</table>
  
</nav>
    <script>function inset()
{$.post("./insertWord.php",{word:$('#word_add').val(),read:$('#read_add').val(),mean:$('#mean_add').val(),},function(data,status){if(json1.code=='success')
{$('#word_add').val('');$('#read_add').val('');$('#mean_add').val('');window.location.reload();}
else if(json1.code=='103')
{alert(json1.code);}
else if(json1.code=='102')
{}
else
{}});}
function add(id)
{$.post("http://liveser.cn/addFre",{data:id},function(data,status){json1=eval("("+data+")");if(json1.code=='success')
{window.location.reload();}
else if(json1.code=='103')
{alert(json1.code);}
else if(json1.code=='102')
{}
else
{}});}
function reading(id)
{if($('#re'+id).text()=='+++++')
{$.post("http://liveser.cn/showReading",{data:id},function(data,status){json1=eval("("+data+")");if(json1.code=='success')
{$('#re'+id).text(json1.content);}
else if(json1.code=='103')
{alert(json1.code);}
else if(json1.code=='102')
{}
else
{}});}
else
{$('#re'+id).text('+++++');}}
function meaning(id)
{if($('#me'+id).text()=='+++++')
{$.post("http://liveser.cn/showMeaning",{data:id},function(data,status){json1=eval("("+data+")");if(json1.code=='success')
{$('#me'+id).text(json1.content);}
else if(json1.code=='103')
{alert(json1.code);}
else if(json1.code=='102')
{}
else
{}});}
else
{$('#me'+id).text('+++++');}}</script>
   
     
   
    <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="http://cdn.bootcss.com/unveil/1.3.0/jquery.unveil.min.js"></script>
    <script src="http://cdn.bootcss.com/scrollup/2.4.0/jquery.scrollUp.min.js"></script>
    <script src="http://cdn.bootcss.com/toc/0.3.2/toc.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery.matchHeight/0.5.2/jquery.matchHeight-min.js"></script>
    <script src="http://static.bootcss.com/www/assets/js/site.min.js"></script>


    

<a style="position: fixed; z-index: 2147483647; display: none;" href="#top" id="scrollUp"><i class="fa fa-angle-up"></i></a>
	</body>
</html>
